<template>
  <!-- 废弃 - 弹窗 -->
  <a-modal
    :visible="true"
    title="废弃"
    width="472px"
    class="discard-model"
    @cancel="dismiss"
    @ok="okBtnClick"
  >
    <template #closeIcon>
      <svg-icon icon-class="icon_search_delete" class-name="icon-search-delete"></svg-icon>
    </template>
    <!-- 标签内容 -->
    <div class="info-content">
      <div class="content-text">
        <span>*</span>
        <span class="text-tips">处理意见</span>
      </div>
      <a-textarea v-model:value="contentTextValue" placeholder="请输入内容" :maxlength="100" />
      <span class="text-count">{{ contentTextValue.length }}/100</span>
    </div>
  </a-modal>
</template>
<script setup>
import { defineProps, defineEmits, ref } from 'vue';
import { message } from 'ant-design-vue';
const props = defineProps({
  recordId: {
    type: Number,
    default: 0
  }
});
const contentTextValue = ref('');

const emit = defineEmits(['onModalMakeSure', 'onModalDismiss']);
function okBtnClick() {
  if (contentTextValue.value.length === 0) {
    message.warning('请输入处理意见');
    return;
  }
  emit('onModalMakeSure', contentTextValue.value);
}
function dismiss() {
  // console.log('dismiss');
  emit('onModalDismiss');
}
</script>
<style lang="less">
.discard-model {
  top: 100px;
  .icon-search-delete {
    margin: 23px auto 0;
    width: 20px;
    height: 20px;
  }
  .ant-modal-content {
    width: 472px;
    height: 292px;
    border-radius: 6px;
    .ant-modal-header {
      display: flex;
      align-items: center;
      height: 66px;
      border-radius: 6px;
      border: 0;
      .ant-modal-title {
        font-size: 18px;
        font-family: Source Han Sans CN, Source Han Sans CN-Medium !important;
        font-weight: 500;
        color: rgba(0, 0, 0, 0.8);
      }
      .ant-modal-close {
        height: 66px !important;
      }
    }
    .ant-modal-body {
      padding: 0;
      .info-content {
        position: relative;
        margin-left: 24px;
        width: 424px;
        height: 154px;
        .content-text {
          margin-bottom: 8px;
          font-size: 14px;
          font-family: Source Han Sans CN, Source Han Sans CN-Regular;
          font-weight: 400;
          color: #ff5252;
          line-height: 22px;
          .text-tips {
            color: rgba(0, 0, 0, 0.6);
          }
        }
        .ant-input-textarea {
          width: 424px;
          height: 124px;
          overflow: hidden;
        }
        .ant-input {
          padding: 12px 16px;
          width: 424px;
          height: 124px;
          border: 1px solid rgba(186, 191, 197, 0.4);
          border-radius: 4px;
          font-size: 14px;
          font-family: Source Han Sans CN, Source Han Sans CN-Regular;
          color: rgba(0, 0, 0, 0.8);
          line-height: 22px;
          resize: none;
          &::-webkit-input-placeholder {
            font-family: Source Han Sans CN, Source Han Sans CN-Regular;
            color: rgba(0, 0, 0, 0.2);
            font-weight: 400;
          }
        }
        .text-count {
          position: absolute;
          font-size: 12px;
          font-family: Source Han Sans CN, Source Han Sans CN-Regular;
          font-weight: 400;
          color: rgba(0, 0, 0, 0.2);
          line-height: 20px;
          bottom: 8px;
          right: 8px;
        }

        ::-webkit-scrollbar {
          display: none;
        }
      }
    }
    .ant-modal-footer {
      padding: 16px 24px 0 24px;
      border: 0;
      .ant-btn {
        margin-left: 16px;
        border-radius: 4px;
        font-size: 14px;
        color: rgba(0, 0, 0, 0.4);
        font-family: Source Han Sans CN, Source Han Sans CN-Regular;
        &:hover {
          color: var(--themecolor);
        }
      }
      .ant-btn-primary {
        color: #fff;
        &:hover {
          color: #fff;
        }
      }
    }
  }
}
</style>
